#!/usr/bin/perl
# strict and warnings, basic :D
use strict; 
use warnings; 
use CGI; use Switch; my $cgi=new CGI;

# carriage return for correct and good-looking html and importing filename
my $br=" <br />\n";

# Parameters
our %plugin_config; my $ln; my $res;

# If asks for it. do it
my $active=$plugin_config{'active'};
my @name=split(/,/,$active);
$res.=$cgi->h1($plugin_config{'title'});
foreach (@name){
	switch ($_){
		case /memfree/ {$res.=$cgi->p("Free memory: ".`cat /proc/meminfo|grep MemFree|awk {'print \$2'}`);}
		case /unamea/  {$res.=$cgi->p("Full info: ".`uname -a`);}
		case /unamer/  {$res.=$cgi->p("Kernel Version: ".`uname -r`);}
		case /date/    {$res.=$cgi->p("Date:".`date`);}
		
	}
}

return $cgi->p($res);
